package com.mano233.server.mapper;

import com.mano233.server.po.File;
import com.mano233.server.po.Form;
import com.mano233.server.po.FormUserEditor;
import com.mano233.server.po.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface FormMapperCustom {

    int createNewForm(@Param("eventId") int eventId, @Param("groupSize") int groupSize,
                      @Param("userId") int userId, @Param("formCreateTime") Date formCreateTime);

    FormUserEditor getFormById(@Param("formId") int formId);

    void deleteForm(@Param("formId") int formId);

    void updateFormState(@Param("formId") int formId, @Param("state") int state);

    void updateFormDescription(@Param("description") String description, @Param("formId") int formId);

    void insertFormGroupUser(@Param("groupId") int groupId, @Param("userList") List<User> userList);

    void deleteFormGroupUser(@Param("groupId") int groupId, @Param("userList") List<User> userList);

    int getFormEventId(@Param("formId") int formId);

    List<FormUserEditor> getFormList(@Param("eventId") int eventId);

    void getFormGroup();

    List<Form> getEventFormByState(int eventId, int state);

    List<File> getFileList(int formId);

    void deleteFile(int formId, int fileId);

    void deleteAllFile(int formId);

}
